public class TestLinkedList {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(5);
        myLinkedList.addFirst(4);
        myLinkedList.addFirst(3);
        myLinkedList.addFirst(2);
        myLinkedList.addFirst(1);
        myLinkedList.display();
        myLinkedList.addLast(19);
        myLinkedList.addLast(29);
        myLinkedList.display();
        myLinkedList.addIndex(1,88);
        //myLinkedList.addIndex(10,88);
        myLinkedList.display();
        System.out.println(myLinkedList.contains(88));
        System.out.println(myLinkedList.contains(28));
        myLinkedList.remove(88);
        myLinkedList.display();
        System.out.println("节点个数：" + myLinkedList.size());
        System.out.println("=============");
        myLinkedList.clear();
        myLinkedList.display();

    }

    public static void main1(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(1);
        myLinkedList.display();
        System.out.println("============");
        myLinkedList.remove(1);
        myLinkedList.display();
    }

    public static void main2(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(2);
        myLinkedList.addFirst(2);
        myLinkedList.addFirst(2);
        myLinkedList.display();
        System.out.println("============");
        myLinkedList.removeAllKey(2);
        myLinkedList.display();
    }
}
